<template>
	<view class="right-fix-main-box">
		<image @click="showAgreementHandler(2)" mode="widthFix" class="img" :src="rootImagePath + 'rule-icon.png'">
		</image>
		<!-- <image @click="telHandler" mode="widthFix" class="img" :src="rootImagePath + 'kefu-icon.png'"></image>
		<image
			@click="gotoUrl('https://mp.weixin.qq.com/mp/profile_ext?action=home&__biz=MzI2ODEzMjg1Mg==&scene=124#wechat_redirect')"
			mode="widthFix" class="img" :src="rootImagePath + 'receive-icon.png'"></image>
			 -->
		<youku-agreement v-if="isShowAgreement" :rootImagePath="rootImagePath" :agreementType="agreementType"
			@ok="agreementOkHandler"></youku-agreement>
	</view>

</template>

<script>
	import YoukuAgreement from "@/components/youku-agreement/youku-agreement.vue"
	export default {
		props: ['rootImagePath'],
		data() {
			return {
				isShowAgreement: false,
				agreementType: 1,
			}
		},
		components: {
			'youku-agreement': YoukuAgreement,
		},
		methods: {
			showAgreementHandler(value) {
				this.isShowAgreement = true;
				this.agreementType = value;
			},
			gotoUrl(url) {
				window.location.href = url
			},
			agreementOkHandler() {
				this.isShowAgreement = false;
			},
			gotoWxPlatform() {
				window.location.href =
					'https://mp.weixin.qq.com/mp/profile_ext?action=home&__biz=MzI2ODEzMjg1Mg==&scene=124#wechat_redirect'
			},
			telHandler() {
				uni.makePhoneCall({
					phoneNumber: '4008825010'
				})
			}
		}
	}
</script>

<style lang="scss">
	.right-fix-main-box {
		position: absolute;
		right: 21rpx;
		top: 44rpx;

		.img {
			width: 104rpx;
			height: auto;
			display: block;
			margin-bottom: 20rpx;
		}
	}
</style>